@echo off
for /f %d in ('dir ..\  /s /b /ad ^| find "\generated"') do rd /S /Q %d